<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>上传农事作业图片</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
<link href="${path}/res/js/webuploader/webuploader.css" rel="stylesheet" type="text/css" />
<style type="text/css">

</style>
</head>
<body>
<form id="form" action="${path}/proRecord/saveImgs.json" method="post">
<div class="form">
	<div class="group">
		<div class="label">地块名称:</div>
		<div class="text">${proRecord.blockName }</div>
	</div>
	<div class="group">
		<div class="label">种植作物:</div>
		<div class="text">${cropName }</div>
	</div>
	<div class="group" style="margin-bottom:0;">
		<div class="text">上传图片:</div>
	</div>
	<div class="group">
		<div class="label" style="width:20px;">&nbsp;</div>
		<div class="item"><div id="myuploader" class="myuploader">${recordImgs }</div></div>
	</div>
	<div class="buttons" style="width:530px;">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
		<input type="hidden" id="recordid" name="recordid" value="${proRecord.recordid }" />
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script src="${path}/res/js/webuploader/webuploader.min.js" type="text/javascript"></script>
<script src="${path}/res/js/webuploader/myUploader.js" type="text/javascript"></script>
<script type="text/javascript">
var myuploader;
$(function() {
	
	myuploader = $("#myuploader").myImgUploader({
		uploadDir: "prorecord_img",
		canEditDesc: true
	});
	
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "上传农事作业图片成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		if(!myuploader.isDone()){
			UiUtil.unlockButton('submit1');
			return;
		}
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>